package com.mall.mymall.service.impl;

import com.mall.mymall.dao.dto.OrderDetailsDto;
import com.mall.mymall.dao.entity.OrderDetails;
import com.mall.mymall.mapper.OrderDetailsMapper;
import com.mall.mymall.service.OrderDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 十里坡
 * @since 2025-03-06
 */
@Service
public class OrderDetailsServiceImpl extends ServiceImpl<OrderDetailsMapper, OrderDetails> implements OrderDetailsService {

    @Autowired
    OrderDetailsMapper orderDetailsMapper;

    @Override
    public List<OrderDetailsDto> getOrderDetails(Integer orderId) {

        List<OrderDetailsDto> orderDetails = orderDetailsMapper.getOrderDetails(orderId);

        if(orderDetails == null){
            return null;
        }
        return orderDetails;
    }
}
